/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.rhythm.commons.io;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.PrintWriter;

/**
 *
 * @author mlee
 */
public class IOWriters {

    public static synchronized void append(File file, String str) throws IOException {
        PrintWriter out = null;
        FileOutputStream outputStream = new FileOutputStream(file, true);
        try {

            out = new PrintWriter(outputStream);
            out.print(str);

        } finally {
            outputStream.flush();

            if (out != null) {
                out.close();
            }
        }
    }
}
